<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>AI 面试系统 - 注册</title>
    <link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css"
      rel="stylesheet"
    />
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css"
    />
    <style>
      body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
        font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
      }
      .register-container {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem 0;
      }
      .register-card {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border: none;
        border-radius: 20px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
      }
      .register-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
      }
      .brand-title {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-weight: 700;
        margin-bottom: 1rem;
      }
      .form-control {
        border-radius: 10px;
        border: 2px solid #e9ecef;
        padding: 12px 15px;
        transition: all 0.3s ease;
      }
      .form-control:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
      }
      .btn-register {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        border-radius: 10px;
        padding: 12px;
        font-weight: 600;
        transition: all 0.3s ease;
      }
      .btn-register:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
      }
      .alert {
        border-radius: 10px;
        border: none;
      }
      .ai-icon {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }
      .step-indicator {
        display: flex;
        justify-content: center;
        margin-bottom: 2rem;
      }
      .step {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #e9ecef;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 10px;
        color: #6c757d;
        font-weight: 600;
      }
      .step.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
      }
    </style>
  </head>
  <body>
    <div class="register-container">
      <div class="container">
        <div class="row justify-content-center">
          <div class="col-md-8 col-lg-7 col-xl-6">
            <div class="card register-card">
              <div class="card-body p-5">
                <div class="text-center mb-4">
                  <i
                    class="bi bi-person-plus ai-icon"
                    style="font-size: 3rem"
                  ></i>
                  <h2 class="brand-title">创建账户</h2>
                  <p class="text-muted">加入AI面试系统，开启智能面试之旅</p>
                </div>

                <div class="step-indicator">
                  <div class="step active">1</div>
                  <div class="step">2</div>
                  <div class="step">3</div>
                </div>

                <div
                  th:if="${errorMessage}"
                  class="alert alert-danger d-flex align-items-center"
                >
                  <i class="bi bi-exclamation-triangle me-2"></i>
                  [[${errorMessage}]]
                </div>

                <form th:action="@{/register}" method="post">
                  <div class="row">
                    <div class="col-md-6 mb-4">
                      <label for="fullName" class="form-label fw-semibold">
                        <i class="bi bi-person-badge me-2"></i>全称
                      </label>
                      <input
                        type="text"
                        class="form-control"
                        id="fullName"
                        name="fullName"
                        th:value="${fullName}"
                        placeholder="请输入您的真实姓名"
                        required
                      />
                    </div>
                    <div class="col-md-6 mb-4">
                      <label for="username" class="form-label fw-semibold">
                        <i class="bi bi-person me-2"></i>用户名
                      </label>
                      <input
                        type="text"
                        class="form-control"
                        id="username"
                        name="username"
                        th:value="${username}"
                        placeholder="请输入用户名"
                        required
                      />
                    </div>
                  </div>

                  <div class="mb-4">
                    <label for="email" class="form-label fw-semibold">
                      <i class="bi bi-envelope me-2"></i>邮箱地址
                    </label>
                    <input
                      type="email"
                      class="form-control"
                      id="email"
                      name="email"
                      th:value="${email}"
                      placeholder="请输入您的邮箱地址"
                      required
                    />
                  </div>

                  <div class="mb-4">
                    <label for="password" class="form-label fw-semibold">
                      <i class="bi bi-lock me-2"></i>密码
                    </label>
                    <input
                      type="password"
                      class="form-control"
                      id="password"
                      name="password"
                      placeholder="请输入密码（至少6位）"
                      required
                      minlength="6"
                    />
                    <div class="form-text">
                      <i class="bi bi-info-circle me-1"></i>
                      密码长度至少6位，建议包含字母和数字
                    </div>
                  </div>

                  <div class="d-grid mb-4">
                    <button type="submit" class="btn btn-primary btn-register">
                      <i class="bi bi-person-plus me-2"></i>创建账户
                    </button>
                  </div>
                </form>

                <div class="text-center">
                  <p class="text-muted mb-0">已经有账户了？</p>
                  <a
                    th:href="@{/login}"
                    class="text-decoration-none fw-semibold"
                  >
                    立即登录 <i class="bi bi-arrow-right"></i>
                  </a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
  </body>
</html>
